<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div>
        <button onclick="test0(event)" style="color: red;font-size: 20px;">0、探索事件的属性</button>
        <a href="http://www.baidu.com" onclick="test1()">点击跳转</a>
        <a href="http://www.baidu.com" onclick="test2(event)">点击不跳转</a>
    </div>

</body>

<script type="text/javascript">
    function test0(e) {
        console.log("点击了0#，event：", e)
        console.log("点击了0#，event.target：", e.target)
        console.log("点击了0#，event.target.style：", e.target.style)
        e.target.style.color = "blue";  //点击后，颜色样式变蓝
    }
    function test1() {
        console.log("点击了1#")
    }
    function test2(e) {
        console.log("点击了2#")
        e.preventDefault(); //阻止默认事件
    }
</script>

</html>